const express = require("express");

const login = require("./modules/login");       // 登录
const resetpw = require("./modules/resetpw");   // 修改密码
const getusername = require("./modules/getusername")
const getlists = require("./modules/getlist");  // 获取事件列表
const addlists = require("./modules/addlists"); //添加事件列表
const changelists = require("./modules/changelists") //编辑事件列表
const searchlists = require("./modules/searchlists") // 查询事件
const dellists = require("./modules/dellists") // 删除事件
// 船只管理
const getships = require('./modules/getships');
const addships = require("./modules/addships");
const searchships = require("./modules/searchships");
const delships = require("./modules/delships");
const editships = require("./modules/editships");

// 水质
const addqualitys = require("./modules/qualitys/addqualitys");
const getqualitys = require("./modules/qualitys/getqualitys");
const delqualitys = require("./modules/qualitys/delqualitys");


// 应急预案--专家库
const addexperts = require("./modules/experts/addexperts");
const getexperts = require("./modules/experts/getexperts");
const searchexperts = require("./modules/experts/searchexperts");
const delexperts = require("./modules/experts/delexperts");
const editexperts = require("./modules/experts/editexperts");
// 应急预案--救援力量
const addpowers = require("./modules/powers/addpowers");
const delpowers = require("./modules/powers/delpowers");
const getpowers = require("./modules/powers/getpowers");
const searchpowers = require("./modules/powers/searchpowers");
const editpowers = require("./modules/powers/editpowers");
// 应急预案--预案管理
const addplans = require("./modules/plan/addplan");
const getplans = require("./modules/plan/getplan");
const editplans = require("./modules/plan/editplan");
const delplans = require("./modules/plan/delplan");
const searchplans = require("./modules/plan/searchplan");
//应急预案--应急处理
const addemergencys = require("./modules/emergencys/addemergencys");
const getemergencys = require("./modules/emergencys/getemergencys");
const delemergencys = require("./modules/emergencys/delemergencys");
const editemergencys = require("./modules/emergencys/editemergencys");
const searchemergencys = require("./modules/emergencys/searchemergencys");
//应急预案--指挥机构
const addorgs = require("./modules/orgs/addorgs");
const editorgs = require("./modules/orgs/editorgs");
const delorgs = require("./modules/orgs/delorgs");
const searchorgs = require("./modules/orgs/searchorgs");
const getorgs = require("./modules/orgs/getorgs");
 //管理员权限
 const addusers = require("./modules/addusers");
 const getusers = require("./modules/getusers");
 const delusers = require("./modules/delusers");
 const editusers = require("./modules/editusers");
 const searchusers = require("./modules/searchusers")

const formidableMiddleware = require('express-formidable');


const app = express();
const bodyParser = require('body-parser')


app.use(formidableMiddleware());

app.post("/waters/login",login); // 登录
app.post("/waters/resetpw",resetpw); // 修改密码
app.post("/waters/getusername",getusername)
// 事件列表
app.post("/waters/getlists",getlists);  //获取事件列表
app.post("/waters/addlists",addlists); //添加事件列表
app.post("/waters/changelists",changelists); //编辑事件
app.post("/waters/searchlists",searchlists); // 查询事件
app.post("/waters/dellists",dellists); // 删除事件

//船只管理
app.post("/waters/getships",getships); //获取船只
app.post("/waters/addships",addships);  // 添加
app.post("/waters/searchships",searchships); //查找
app.post("/waters/delships",delships);  // 删除
app.post("/waters/editships",editships); // 编辑

// 水质
app.post("/waters/addqualitys",addqualitys);
app.post("/waters/getqualitys",getqualitys);
app.post("/waters/delqualitys",delqualitys)

// 应急预案--专家库
app.post("/waters/addexperts",addexperts)
app.post("/waters/getexperts",getexperts)
app.post("/waters/searchexperts",searchexperts)
app.post("/waters/delexperts",delexperts)
app.post("/waters/editexperts",editexperts)

//应急预案--救援力量
app.post("/waters/addpowers",addpowers);
app.post("/waters/delpowers",delpowers);
app.post("/waters/editpowers",editpowers);
app.post("/waters/searchpowers",searchpowers);
app.post("/waters/getpowers",getpowers);
// 应急预案--预案管理
app.post("/waters/addplans",addplans);
app.post("/waters/getplans",getplans);
app.post("/waters/editplans",editplans);
app.post("/waters/delplans",delplans);
app.post("/waters/searchplans",searchplans)
//应急预案--应急处理
app.post("/waters/addemergencys",addemergencys);
app.post("/waters/getemergencys",getemergencys);
app.post("/waters/delemergencys",delemergencys);
app.post("/waters/editemergencys",editemergencys);
app.post("/waters/searchemergencys",searchemergencys);
//应急预案--指挥机构
app.post("/waters/addorgs",addorgs);
app.post("/waters/getorgs",getorgs);
app.post("/waters/delorgs",delorgs);
app.post("/waters/editorgs",editorgs);
app.post("/waters/searchorgs",searchorgs);
//管理员权限
app.post("/waters/addusers",addusers);
app.post("/waters/delusers",delusers);
app.post("/waters/getusers",getusers);
app.post("/waters/editusers",editusers);
app.post("/waters/searchusers",searchusers)


app.listen(10345,()=>{
    console.log("服务器开启成功");
})